<template>
  <div>
    <Search @search="change($event)"></Search>
    <van-card
  :price="item.prices"
  :desc="item.desc"
  :title="item.title"
  :thumb="item.img"
  v-for="(item,i) in list"
  :key="i"
/>
  </div>
</template>

<script>
import Search from "../components/SearchBar";
import {searchClass} from "../api/Recommend"
  export default {
    data(){
      return{
        list:''
      }
    },
    mounted(){
      console.log(11);
    },
    methods:{
      change(input){
        searchClass(input).then(res=>{
          this.list=res.data
        })
      },
    },
    components: {
    Search,
  },
  }
</script>

<style scoped>

</style>